package cn.com.dcsgo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 菜单管理
 */
@Data
@TableName(value = "sys_menu")
@Schema(description = "菜单")
public class SysMenu {
    /**
     * 菜单ID
     */
    @TableId(type = IdType.AUTO)
    @Schema(description = "菜单ID")
    private Long menuId;

    /**
     * 父菜单ID，一级菜单为0
     */
    @Schema(description = "父菜单ID，一级菜单为0")
    private Long parentId;

    /**
     * 菜单名称
     */
    @Schema(description = "菜单名称")
    private String name;

    /**
     * 菜单URL
     */
    @Schema(description = "菜单URL")
    private String url;

    /**
     * 权限(多个用逗号分隔，如：user:list,user:create)
     */
    @Schema(description = "权限(多个用逗号分隔，如：user:list,user:create)")
    private String perms;

    /**
     * 类型   0：目录   1：菜单   2：按钮
     */
    @Schema(description = "菜单类型（0：目录，1：菜单，2：按钮）")
    private Integer type;

    /**
     * 菜单图标
     */
    @Schema(description = "菜单图标")
    private String icon;

    /**
     * 排序数(默认升序)
     */
    @Schema(description = "排序数(升序)")
    private Integer orderNum;

    /**
     * 子菜单
     */
    @TableField(exist = false)
    @Schema(description = "子菜单")
    private List<SysMenu> list = new ArrayList<>();
}